Optimal. Leaf size=173 \[ \frac {x}{a^3}-\frac {b \left (6 a^4-5 a^2 b^2+2 b^4\right ) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^3 (a-b)^{5/2} (a+b)^{5/2} d}+\frac {b^2 \tan (c+d x)}{2 a \left (a^2-b^2\right ) d (a+b \sec (c+d x))^2}+\frac {b^2 \left (5 a^2-2 b^2\right ) \tan (c+d x)}{2 a^2 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.23, antiderivative size = 173, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3870, 4145,
4004, 3916, 2738, 214} \begin {gather*} \frac {x}{a^3}+\frac {b^2 \left (5 a^2-2 b^2\right ) \tan (c+d x)}{2 a^2 d \left (a^2-b^2\right )^2 (a+b \sec (c+d x))}+\frac {b^2 \tan (c+d x)}{2 a d \left (a^2-b^2\right ) (a+b \sec (c+d x))^2}-\frac {b \left (6 a^4-5 a^2 b^2+2 b^4\right ) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^3 d (a-b)^{5/2} (a+b)^{5/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 214
Rule 2738
Rule 3870
Rule 3916
Rule 4004
Rule 4145
Rubi steps
\begin {align*} \int \frac {1}{(a+b \sec (c+d x))^3} \, dx &=\frac {b^2 \tan (c+d x)}{2 a \left (a^2-b^2\right ) d (a+b \sec (c+d x))^2}-\frac {\int \frac {-2 \left (a^2-b^2\right )+2 a b \sec (c+d x)-b^2 \sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx}{2 a \left (a^2-b^2\right )}\\ &=\frac {b^2 \tan (c+d x)}{2 a \left (a^2-b^2\right ) d (a+b \sec (c+d x))^2}+\frac {b^2 \left (5 a^2-2 b^2\right ) \tan (c+d x)}{2 a^2 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))}+\frac {\int \frac {2 \left (a^2-b^2\right )^2-a b \left (4 a^2-b^2\right ) \sec (c+d x)}{a+b \sec (c+d x)} \, dx}{2 a^2 \left (a^2-b^2\right )^2}\\ &=\frac {x}{a^3}+\frac {b^2 \tan (c+d x)}{2 a \left (a^2-b^2\right ) d (a+b \sec (c+d x))^2}+\frac {b^2 \left (5 a^2-2 b^2\right ) \tan (c+d x)}{2 a^2 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))}-\frac {\left (b \left (6 a^4-5 a^2 b^2+2 b^4\right )\right ) \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx}{2 a^3 \left (a^2-b^2\right )^2}\\ &=\frac {x}{a^3}+\frac {b^2 \tan (c+d x)}{2 a \left (a^2-b^2\right ) d (a+b \sec (c+d x))^2}+\frac {b^2 \left (5 a^2-2 b^2\right ) \tan (c+d x)}{2 a^2 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))}-\frac {\left (6 a^4-5 a^2 b^2+2 b^4\right ) \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{2 a^3 \left (a^2-b^2\right )^2}\\ &=\frac {x}{a^3}+\frac {b^2 \tan (c+d x)}{2 a \left (a^2-b^2\right ) d (a+b \sec (c+d x))^2}+\frac {b^2 \left (5 a^2-2 b^2\right ) \tan (c+d x)}{2 a^2 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))}-\frac {\left (6 a^4-5 a^2 b^2+2 b^4\right ) \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^3 \left (a^2-b^2\right )^2 d}\\ &=\frac {x}{a^3}-\frac {b \left (6 a^4-5 a^2 b^2+2 b^4\right ) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^3 (a-b)^{5/2} (a+b)^{5/2} d}+\frac {b^2 \tan (c+d x)}{2 a \left (a^2-b^2\right ) d (a+b \sec (c+d x))^2}+\frac {b^2 \left (5 a^2-2 b^2\right ) \tan (c+d x)}{2 a^2 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.81, size = 205, normalized size = 1.18 \begin {gather*} \frac {(b+a \cos (c+d x)) \sec ^3(c+d x) \left (2 (c+d x) (b+a \cos (c+d x))^2+\frac {2 b \left (6 a^4-5 a^2 b^2+2 b^4\right ) \tanh ^{-1}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right ) (b+a \cos (c+d x))^2}{\left (a^2-b^2\right )^{5/2}}+\frac {a b^3 \sin (c+d x)}{(-a+b) (a+b)}+\frac {3 a b^2 \left (2 a^2-b^2\right ) (b+a \cos (c+d x)) \sin (c+d x)}{(a-b)^2 (a+b)^2}\right )}{2 a^3 d (a+b \sec (c+d x))^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.18, size = 237, normalized size = 1.37
method | result | size |
derivativedivides | \(\frac {\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{3}}+\frac {2 b \left (\frac {-\frac {\left (6 a^{2}+b a -2 b^{2}\right ) b a \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 \left (a -b \right ) \left (a^{2}+2 b a +b^{2}\right )}+\frac {\left (6 a^{2}-b a -2 b^{2}\right ) b a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 \left (a +b \right ) \left (a^{2}-2 b a +b^{2}\right )}}{\left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-a -b \right )^{2}}-\frac {\left (6 a^{4}-5 b^{2} a^{2}+2 b^{4}\right ) \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{2 \left (a^{4}-2 b^{2} a^{2}+b^{4}\right ) \sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a^{3}}}{d}\) | \(237\) |
default | \(\frac {\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{3}}+\frac {2 b \left (\frac {-\frac {\left (6 a^{2}+b a -2 b^{2}\right ) b a \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 \left (a -b \right ) \left (a^{2}+2 b a +b^{2}\right )}+\frac {\left (6 a^{2}-b a -2 b^{2}\right ) b a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 \left (a +b \right ) \left (a^{2}-2 b a +b^{2}\right )}}{\left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-a -b \right )^{2}}-\frac {\left (6 a^{4}-5 b^{2} a^{2}+2 b^{4}\right ) \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{2 \left (a^{4}-2 b^{2} a^{2}+b^{4}\right ) \sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{a^{3}}}{d}\) | \(237\) |
risch | \(\frac {x}{a^{3}}-\frac {i b^{2} \left (-7 b \,a^{3} {\mathrm e}^{3 i \left (d x +c \right )}+4 a \,b^{3} {\mathrm e}^{3 i \left (d x +c \right )}-6 a^{4} {\mathrm e}^{2 i \left (d x +c \right )}-9 a^{2} b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+6 b^{4} {\mathrm e}^{2 i \left (d x +c \right )}-17 a^{3} b \,{\mathrm e}^{i \left (d x +c \right )}+8 b^{3} a \,{\mathrm e}^{i \left (d x +c \right )}-6 a^{4}+3 b^{2} a^{2}\right )}{a^{3} \left (-a^{2}+b^{2}\right )^{2} d \left (a \,{\mathrm e}^{2 i \left (d x +c \right )}+2 b \,{\mathrm e}^{i \left (d x +c \right )}+a \right )^{2}}+\frac {3 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d}-\frac {5 b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{2 \sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d a}+\frac {b^{5} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d \,a^{3}}-\frac {3 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d}+\frac {5 b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{2 \sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d a}-\frac {b^{5} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2} d \,a^{3}}\) | \(683\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 431 vs.
\(2 (160) = 320\).
time = 3.16, size = 919, normalized size = 5.31 \begin {gather*} \left [\frac {4 \, {\left (a^{8} - 3 \, a^{6} b^{2} + 3 \, a^{4} b^{4} - a^{2} b^{6}\right )} d x \cos \left (d x + c\right )^{2} + 8 \, {\left (a^{7} b - 3 \, a^{5} b^{3} + 3 \, a^{3} b^{5} - a b^{7}\right )} d x \cos \left (d x + c\right ) + 4 \, {\left (a^{6} b^{2} - 3 \, a^{4} b^{4} + 3 \, a^{2} b^{6} - b^{8}\right )} d x + {\left (6 \, a^{4} b^{3} - 5 \, a^{2} b^{5} + 2 \, b^{7} + {\left (6 \, a^{6} b - 5 \, a^{4} b^{3} + 2 \, a^{2} b^{5}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (6 \, a^{5} b^{2} - 5 \, a^{3} b^{4} + 2 \, a b^{6}\right )} \cos \left (d x + c\right )\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) + 2 \, {\left (5 \, a^{5} b^{3} - 7 \, a^{3} b^{5} + 2 \, a b^{7} + 3 \, {\left (2 \, a^{6} b^{2} - 3 \, a^{4} b^{4} + a^{2} b^{6}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, {\left ({\left (a^{11} - 3 \, a^{9} b^{2} + 3 \, a^{7} b^{4} - a^{5} b^{6}\right )} d \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{10} b - 3 \, a^{8} b^{3} + 3 \, a^{6} b^{5} - a^{4} b^{7}\right )} d \cos \left (d x + c\right ) + {\left (a^{9} b^{2} - 3 \, a^{7} b^{4} + 3 \, a^{5} b^{6} - a^{3} b^{8}\right )} d\right )}}, \frac {2 \, {\left (a^{8} - 3 \, a^{6} b^{2} + 3 \, a^{4} b^{4} - a^{2} b^{6}\right )} d x \cos \left (d x + c\right )^{2} + 4 \, {\left (a^{7} b - 3 \, a^{5} b^{3} + 3 \, a^{3} b^{5} - a b^{7}\right )} d x \cos \left (d x + c\right ) + 2 \, {\left (a^{6} b^{2} - 3 \, a^{4} b^{4} + 3 \, a^{2} b^{6} - b^{8}\right )} d x - {\left (6 \, a^{4} b^{3} - 5 \, a^{2} b^{5} + 2 \, b^{7} + {\left (6 \, a^{6} b - 5 \, a^{4} b^{3} + 2 \, a^{2} b^{5}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (6 \, a^{5} b^{2} - 5 \, a^{3} b^{4} + 2 \, a b^{6}\right )} \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) + {\left (5 \, a^{5} b^{3} - 7 \, a^{3} b^{5} + 2 \, a b^{7} + 3 \, {\left (2 \, a^{6} b^{2} - 3 \, a^{4} b^{4} + a^{2} b^{6}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{11} - 3 \, a^{9} b^{2} + 3 \, a^{7} b^{4} - a^{5} b^{6}\right )} d \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{10} b - 3 \, a^{8} b^{3} + 3 \, a^{6} b^{5} - a^{4} b^{7}\right )} d \cos \left (d x + c\right ) + {\left (a^{9} b^{2} - 3 \, a^{7} b^{4} + 3 \, a^{5} b^{6} - a^{3} b^{8}\right )} d\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{\left (a + b \sec {\left (c + d x \right )}\right )^{3}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 322 vs.
\(2 (160) = 320\).
time = 0.47, size = 322, normalized size = 1.86 \begin {gather*} \frac {\frac {{\left (6 \, a^{4} b - 5 \, a^{2} b^{3} + 2 \, b^{5}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )}}{{\left (a^{7} - 2 \, a^{5} b^{2} + a^{3} b^{4}\right )} \sqrt {-a^{2} + b^{2}}} - \frac {6 \, a^{3} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 5 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, a b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, a^{3} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 5 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a^{6} - 2 \, a^{4} b^{2} + a^{2} b^{4}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a - b\right )}^{2}} + \frac {d x + c}{a^{3}}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.22, size = 2500, normalized size = 14.45 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________